package com.readygo.boot_test.repository;


import com.readygo.boot_test.entity.User;
import com.readygo.boot_test.vo.UserCourse;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface UserRepository extends CrudRepository<User, Integer> {

//    @Query("SELECT new com.readygo.boot_test.vo.UserCourse(u.username, c.courseName) FROM User as u INNER JOIN com.readygo.boot_test.entity.Course as c ON c.userId=User.userId AND User.userId=:userId")
//    List<UserCourse> findUserCourseByUserId(Integer userId);

}
